<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //基础测试,获取一个用户的信息
        async function fu(){
            console.log('开始获取用户姓名');
         const p1 = await new Promise((resolve,reject)=>{
                try{
                    setTimeout(()=>{
                        console.log('获取用户姓名成功');
                        const name = {
                            name : 'chen'
                        }
                        resolve(name)
                    },1000)
                }
                catch(e){
                    reject(e.message)
                }
            })

            console.log('开始获取用户手机号');
         const p2 = await new Promise((resolve,reject)=>{
                try{
                    setTimeout(()=>{
                        console.log('获取用户手机号成功');
                        const number = {
                            number : '131313131313'
                        }
                        resolve({...p1,...number})
                    },1500)
                }
                catch(e){
                    reject(e.message)
                }
            })

            console.log('开始获取用户性别');
         const p3 =  await new Promise((resolve,reject)=>{
                try{
                    setTimeout(()=>{
                        console.log('获取用户性别成功');
                        const sex = {
                            sex : '男'
                        }
                        resolve({...p2,...sex})
                    },1500)
                }
                catch(e){
                    reject(e.message)
                }
            })

            console.log('完整数据',p3);
        }

        fu();
    </script>
</body>
</html>